import {mergeAttributes, Node} from "@tiptap/core";
import {ReactNodeViewRenderer} from "@tiptap/react";
import {WordView} from "../../mp3Player/Paragraph/Word";

export const MyWord = Node.create({
    group:'inline',
    name:'word' ,
    atom: true,
    inline:true,
    addAttributes() {
        return {
            start:0,
            end:0,
            text:""
        }
    },
    renderHTML({HTMLAttributes}) {
        return ['word', mergeAttributes(HTMLAttributes), 0];
    },
    addNodeView() {
        return ReactNodeViewRenderer(WordView);
    },
});